package com.cqhilink.api.common.utils;

import java.util.UUID;

/**
 * 唯一性工具
 * Created by wangzhen on 2016/1/25.
 */
public class UniqueUtil {
    /**
     * 获取UUID
     */
    public static String uuid() {
        UUID uuid = UUID.randomUUID();
        return uuid.toString().replace("-", "").toUpperCase();
    }

    /**
     * 获取UUID截取16位
     * @return
     */
    public static String uuid16() {
        UUID uuid = UUID.randomUUID();
        return uuid.toString().replace("-", "").toUpperCase().substring(0,16);
    }

    public static void main(String[] args) {
        System.out.println(uuid());
    }
}
